import Vue from "vue";
import VueRouter from "vue-router";
import OneHomePage from "@/views/one-homePage.vue";
import OneArticle from "@/views/one-article.vue";
import OneLogin from "@/views/one-login.vue";
import TwoShouye from "@/views/two-shouye.vue";
import TwoWenda from "@/views/two-wenda.vue";
import TwoShipin from "@/views/two-shipin.vue";
import TwoWode from "@/views/two-wode.vue";
import OneShoucanglishi from "@/views/one-shoucanglishi.vue";
import OneXiaozhi from "@/views/one-xiaozhi.vue";
import TwoShoucang from "@/views/two-shoucang.vue";
import TwoLishi from "@/views/two-lishi.vue";
import OneOwnmessage from "@/views/one-ownmessage.vue";
import OneChangemessage from "@/views/one-changemessage.vue";
import OneList from "@/views/one-List.vue";
import TwoToutiao from "@/views/two-toutiao.vue";
import TwoGuanzhu from "@/views/two-guanzhu.vue";
import TwoFensi from "@/views/two-fensi.vue";
import TwoHuozan from "@/views/two-huozan.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: OneHomePage,
    children: [
      {
        path: "shouye",
        component: TwoShouye,
      },
      {
        path: "wenda",
        component: TwoWenda,
      },
      {
        path: "shipin",
        component: TwoShipin,
      },
      {
        path: "wode",
        name: "wode",
        component: TwoWode,
      },
    ],
  },
  {
    path: "/article",
    component: OneArticle,
  },
  {
    path: "/login",
    name: "Login",
    component: OneLogin,
  },
  {
    path: "/sl",
    name: "OneShoucanglishi",
    component: OneShoucanglishi,
    children: [
      {
        path: "shoucang",
        name: "shoucang",
        component: TwoShoucang,
      },
      {
        path: "lishi",
        name: "lishi",
        component: TwoLishi,
      },
    ],
  },
  {
    path: "/xz",
    name: "OneXiaozhi",
    component: OneXiaozhi,
  },
  {
    path: "/omessage",
    name: "OneOwnmessage",
    component: OneOwnmessage,
  },
  {
    path: "/changemes",
    name: "OneChangemessage",
    component: OneChangemessage,
  },
  {
    path: "/List/",
    component: OneList,
    redirect: "/List/toutiao",
    children: [
      {
        path: "toutiao",
        name: "toutiao",
        component: TwoToutiao,
      },
      {
        path: "guanzhu",
        name: "guanzhu",
        component: TwoGuanzhu,
      },
      {
        path: "fans",
        name: "fans",
        component: TwoFensi,
      },
      {
        path: "zan",
        name: "zan",
        component: TwoHuozan,
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
